﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class sentEcard : System.Web.UI.Page
{
    private bussiness bus;
    string id;
    protected void Page_Load(object sender, EventArgs e)
    {
        txtDateSent.Text =string.Format( "{0:MM/dd/yyyy}",DateTime.Now)+"(today)";
        bus = new bussiness();
        id = Request.QueryString["id"];
        List<Ecard> lstEcard = bus.getAllEcard();
        List<Ecard> lstEcard_display = new List<Ecard>();
        foreach (Ecard ecard in lstEcard)
        {
            if (ecard.EcardId == Convert.ToInt32(id))
            {
                lstEcard_display.Add(ecard);
                Repeater1.DataSource = lstEcard_display;
                Repeater1.DataBind();
                break;
            }
        }
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        DateTime date = Calendar1.SelectedDate;
        txtDateSent.Text = string.Format("{0:MM/dd/yyyy}", date);
        
    }
}